#include<iostream>
#include<string>

using namespace std;

int main() {
	//string s1;
	//string s2("123456");
	//string s3(10,'*');
	//string s4(s2);
	//cout << s3 << endl;

	string url("https://cplusplus.com/reference/string/string/string/");
	string sub1(url,0,5);
	string sub2(url,8,13);
	string sub3(url,22);
	sub2 = sub3;
	cout << sub1 << endl;
	cout << sub2 << endl;
	cout << sub3 << endl;

	string s1("hello");
	s1.push_back(' ');
	cout << s1 << endl;
	s1.append("world");
	cout << s1 << endl;
	s1 += " 111 ";
	cout << s1 << endl;

	int x = 123456;
	string xstr;
	while (x != 0) {
		int tem = x % 10;
		xstr += (tem + '0');
		x /= 10;
	}
	
	cout << xstr << endl;

	return 0;
} 